<template>
  <div class="bg">
      <div class="text" :class="{select:selectnumber===1}" @click="change(1)">首页</div>
      <div class="text" :class="{select:selectnumber===2}" @click="change(2)">个人信息</div>
      <div class="text" :class="{select:selectnumber===3}" @click="change(3)">设置</div>
  </div>
</template>

<script>
  export default {
    name: 'leftView',
    data() {
      return {
        selectnumber: 1,
      }
    },
    methods: {
      change (e) {
        if (e===this.selectnumber) return
        this.selectnumber = e;
        if (e===1) {
          this.$router.push('home')
        } else if (e===2) {
          this.$router.push('personInfo')
        } else {
          this.$router.push('setting')
        }
      }
    }
  }
</script>

<style lang="stylus" rel="stylesheet/stylus">
  @import "./leftView.styl"
</style>
